//package com.aisile.rabbitmq.config;
//
//import org.springframework.amqp.core.*;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * @Auther:yry
// * @Date:2024/1/12 0012
// * @VERSON:1.0
// */
//@Configuration
//public class RabbitMQConfigTTLDLX {
//
//    // 死信交换机交换机名称  ctrl+shift+u 转换成小写快捷键
//    public static final String DLX_EXCHANGE = "dlx_exchange";
//    // 死信队列
//    public static final String DELAY_QUEUE = "delay_queue";
//    // 普通消息队列
//    public static final String MESSAGE_QUEUE = "message_queue";
//
//
//    @Bean(MESSAGE_QUEUE)
//    public Queue MESSAGE_QUEUE(){
//        return new Queue(MESSAGE_QUEUE,true);
//    }
//
//    @Bean(DELAY_QUEUE)
//    public Queue DELAY_QUEUE(){
//        return QueueBuilder.durable(DELAY_QUEUE)
//                .withArgument("x-dead-letter-exchange",DLX_EXCHANGE)
//                .withArgument("x-dead-letter-routing-key",DLX_EXCHANGE).build();
//    }
//
//    @Bean(DLX_EXCHANGE)
//    public DirectExchange DLX_EXCHANGE(){
//        return new DirectExchange(DLX_EXCHANGE);
//    }
//
//    @Bean
//    public Binding DLX_EXCHANGE_MESSAGE_QUEUE(
//            @Qualifier(DLX_EXCHANGE) DirectExchange directExchange,
//            @Qualifier(MESSAGE_QUEUE) Queue queue){
//        return BindingBuilder.bind(queue).to(directExchange).with(DLX_EXCHANGE);
//    }
//
//
//
//}
